﻿<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html" ; charset="utf-8" />
    <title>教务信息查询</title>
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />
    <link
      href="../../../bstable/css/bootstrap.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../../../bstable/css/bootstrap-table.css"
      rel="stylesheet"
      type="text/css"
    />
  </head>

  <body>
    <div class="tabe_div">
      <p
        class="p_line text_ient"
        style="border-bottom: 0; margin-bottom: -10px"
      >
        <!-- <a class="find_a">报考类型：</a>
            <select class="form_select" style="padding-left: 1%;" id="type">
                <option value="">全部</option>
                <option value="education">学历提升</option>
                <option value="occupation">职业技能</option>
                <option value="title">职称评审</option>
                <option value="train">执业资格</option>
            </select> -->
        <a class="find_a">审核状态：</a>
        <select class="form_select" style="padding-left: 1%" id="status">
          <option value="">全部</option>
          <option value="0">已保存</option>
          <option value="1">已提交</option>
          <option value="2">待财务审核</option>
          <option value="3">财务驳回</option>
          <option value="4">待教务审核</option>
          <option value="5">教务驳回</option>
          <option value="6">教务确认</option>
          <option value="8">已退款</option>
          <option value="10">财务确认</option>
        </select>
        <a class="find_a">老师姓名：</a>
        <input
          type="text"
          id="teacherName"
          class="form_input text_ient"
          placeholder="输入招生老师手机号"
          maxlength="11"
        />
        <a class="find_a">老师手机号：</a>
        <input
          type="text"
          id="mobile"
          class="form_input text_ient"
          placeholder="输入招生老师手机号"
          maxlength="11"
        />
        <input type="button" value="查询" class="but_find" id="search" />
      </p>
      <p class="p_line text_ient" style="margin-bottom: -10px">
        <a class="find_a">学生姓名：</a>
        <input
          type="text"
          id="name"
          class="form_input text_ient"
          placeholder="输入学生姓名"
          maxlength="18"
        />
        <a class="find_a">学生身份证号：</a>
        <input
          type="text"
          id="card"
          class="form_input text_ient"
          placeholder="输入身份证号"
          maxlength="18"
        />
        <!-- <a class="find_a">学生手机号：</a>
            <input type="number" id="phone" class="form_input text_ient" placeholder="输入学生手机号" maxlength="11" /> -->
        <a class="find_a">业务进度：</a>
        <select
          class="form_select"
          style="padding-left: 1%"
          id="businessProgress"
        >
          <option value="">全部</option>
          <option value="0">报考</option>
          <option value="1">退款</option>
          <option value="2">分期缴费</option>
        </select>
        <a class="find_a">报考项目：</a>
        <input
          type="text"
          id="applyProject"
          class="form_input text_ient"
          placeholder="输入报考项目"
        />
      </p>
      <table
        data-url="json/data_alae_list.json"
        id="table"
        class="table_style"
        style="margin: 20px auto"
      ></table>
    </div>
    <script src="../../../js/jquery.js"></script>
    <script src="../../../js/common.js"></script>
    <script src="../../../js/laydate-master/laydate.js"></script>
    <script src="../../../bstable/js/bootstrap.min.js"></script>
    <script src="../../../bstable/js/bootstrap-table.js"></script>
    <script src="../../../bstable/js/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript">
      localStorage.setItem('name', '教务管理/教务信息管理');
      var pageNumber =
        location.search == '' ? 0 : location.search.split('=')[1];
      $(function () {
        $('#search').on('click', function () {
          $('#table').bootstrapTable('refresh');
        });
        var perm = JSON.parse(localStorage.getItem('userInfo')).perm;
        $('#table').bootstrapTable({
          method: 'get',
          striped: true,
          singleSelect: false,
          url: baseUrl + 'studentInfo/getStudentList',
          dataType: 'json',
          pagination: true, //分页
          sidePagination: 'server',
          pageSize: 10,
          pageNumber: Number(pageNumber) + 1,
          search: false, //显示搜索框
          contentType: 'application/x-www-form-urlencoded',
          // rowStyle:rowStyle,
          ajaxOptions: {
            headers: {
              Authorization: JSON.parse(localStorage.getItem('userInfo')).token,
            },
          },
          queryParams: function (params) {
            const maps = {
              21: 'education',
              22: 'train',
              23: 'occupation',
              24: 'title',
              1: '',
            };
            const perm = JSON.parse(localStorage.getItem('userInfo')).perm;
            params.trainType = maps[perm];
            params.commitFlag = $('#status').val();
            params.businessProgress = $('#businessProgress').val();
            params.applyProject = $('#applyProject').val();
            params.name = $('#name').val();
            params.idNo = $('#card').val();
            // params.mobile = $('#mobile').val()
            params.teacherName = $('#teacherName').val();
            params.teacherMobile = $('#mobile').val();
            params.userType = 'jiaowu';
            params.offset = params.offset / params.limit;
            pageNumber = params.offset;
            delete params.order;
            return params;
          },
          responseHandler: function (res) {
            var list = res.data.result.records;
            var maps = {
              education: '学历提升',
              occupation: '职业技能',
              title: '职称评审',
              train: '执业资格',
            };
            list.forEach(function (item, i) {
              item.trainTypeName = maps[item.trainType];
              !item && (list[i] = {});
              if (item.businessProgress === 0) {
                item.feeFlag = '报考';
              } else if (item.businessProgress === 1) {
                item.feeFlag = '退款';
              } else if (item.businessProgress === 2) {
                item.feeFlag = '分期缴费';
              }
            });
            return {
              rows: list,
              total: res.data.total,
            };
          },
          columns: [
            {
              field: 'no',
              title: '序号',
              sortable: true,
              align: 'center',
              formatter: function (value, row, index) {
                var pageSize =
                  $('#table').bootstrapTable('getOptions').pageSize;
                var pageNumber =
                  $('#table').bootstrapTable('getOptions').pageNumber;
                return pageSize * (pageNumber - 1) + index + 1;
              },
            },
            {
              title: '学生姓名',
              field: 'name',
              align: 'center',
              valign: 'middle',
            },
            {
              title: '身份证号',
              field: 'idNo',
              align: 'center',
            },
            {
              title: '老师姓名',
              field: 'teacherName',
              align: 'center',
            },
            // {
            //     title: '招生老师手机号',
            //     field: 'teacherMobile',
            //     align: 'center'
            // },
            {
              title: '报考项目',
              field: 'applyProject',
              align: 'center',
            },
            {
              title: '报考专业',
              field: 'studentMajor',
              align: 'center',
            },
            {
              title: '报考类型',
              field: 'trainTypeName',
              align: 'center',
            },
            {
              title: '课程开始时间',
              field: 'classStartDate',
              align: 'center',
            },
            {
              title: '课程结束时间',
              field: 'classEndDate',
              align: 'center',
            },
            {
              title: '创建日期',
              field: 'createDate',
              align: 'center',
            },
            {
              title: '报考进度',
              field: 'submissionFlag',
              align: 'center',
              formatter: function (value, row, index) {
                const map = { 0: '未报考', 1: '已报考' };
                return map[row.submissionFlag];
              },
            },
            {
              title: '证书',
              field: 'receiveFlag',
              align: 'center',
              formatter: function (value, row, index) {
                const map = { 0: '未领取', 1: '已领取' };
                return map[row.receiveFlag];
              },
            },
            {
              title: '审核状态',
              field: 'commitStr',
              align: 'center',
            },
            {
              title: '业务进度',
              field: 'feeFlag',
              align: 'center',
            },
            {
              title: '操作',
              field: 'id',
              align: 'center',
              formatter: function (value, row) {
                var e =
                  '<a href="#" onclick="look(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  '\')">查看</a> ';

                var b =
                  '<a href="#" onclick="tuikuanlook(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  "', '" +
                  row.commitFlag +
                  '\')">查看</a> ';

                var d =
                  '<a href="#" onclick="check(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  '\')">审核</a> ';

                var c =
                  '<a href="#" onclick="refund(\'' +
                  row.id +
                  "', '" +
                  row.idNo +
                  "', '" +
                  row.colorFlag +
                  "', '" +
                  row.trainType +
                  "', '" +
                  row.studyId +
                  '\')">审核</a> ';

                var optionStr = row.businessProgress == 1 ? b : e;

                if (row.businessProgress == 0 && row.commitFlag == 4) {
                  optionStr += d;
                }

                if (row.businessProgress == 1 && row.commitFlag == 4) {
                  optionStr += c;
                }

                return optionStr;
              },
            },
          ],
        });
      });

      function look(id, idNo, flag, trainType, studyId) {
        window.location.href =
          '../student/check.html?type=look&id=' +
          id +
          '&idNo=' +
          idNo +
          '&flag=' +
          flag +
          '&trainType=' +
          trainType +
          '&studyId=' +
          studyId +
          '&pageNumber=' +
          pageNumber;
      }

      function tuikuanlook(id, idNo, flag, trainType, studyId, commitFlag) {
        window.location.href =
          '../student/edit.html?type=look&lookName=jw&=no&from=refund&id=' +
          id +
          '&idNo=' +
          idNo +
          '&flag=' +
          flag +
          '&trainType=' +
          trainType +
          '&studyId=' +
          studyId +
          '&pageNumber=' +
          pageNumber +
          '&commitFlag=' +
          commitFlag;
      }

      function check(id, idNo, flag, trainType, studyId) {
        // window.location.href = '../hotel/student_look.html?type=baokao&from=jiaowu&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
        window.location.href =
          '../student/check.html?type=look&from=jiaowu&id=' +
          id +
          '&idNo=' +
          idNo +
          '&flag=' +
          flag +
          '&trainType=' +
          trainType +
          '&studyId=' +
          studyId;
      }

      function refund(id, idNo, flag, trainType, studyId) {
        window.location.href =
          '../student/refund-check.html?type=look&from=jiaowu&action=tuikuan&id=' +
          id +
          '&idNo=' +
          idNo +
          '&flag=' +
          flag +
          '&trainType=' +
          trainType +
          '&studyId=' +
          studyId;
        // window.location.href = '../hotel/student-refund.html?type=tuikuan&from=jiaowu&id=' + id + '&idNo=' + idNo + '&flag=' + flag + '&trainType=' + trainType + '&studyId=' + studyId
      }

      // function rowStyle(item, index) {
      //     style = item.colorFlag == 1 ? {css:{'color':'#ed5565'}} : {}
      //     return style;
      // }
    </script>
  </body>
</html>
